﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace Mysoft.QuickCode.Web
{
    /// <summary>
    /// SQL文件处理类
    /// </summary>
    public class SqlFile
    {
        /// <summary>
        /// 读取文件内容
        /// </summary>
        /// <param name="path">文件路径，用 . 分隔。如 List.sql 路径为 PayPlan.YWCS.List。</param>
        /// <returns></returns>
        public static string GetContent(string path)
        {
            path = path.Replace(@".", @"\");
            return System.IO.File.ReadAllText(HttpContext.Current.Server.MapPath("/") + path + ".sql", Encoding.Default);
        }
    }
}
